$OpenBSD: patch-configure_in,v 1.30 2013/12/15 01:57:55 brad Exp $
--- configure.in.orig	Thu Jan 19 01:30:05 2012
+++ configure.in	Thu Dec  5 14:41:54 2013
@@ -486,6 +486,35 @@ AC_HELP_STRING([--enable-esd-shared], [dynamically loa
     fi
 }
 
+dnl Find Sndio
+CheckSndio()
+{
+    AC_ARG_ENABLE(sndio,
+AC_HELP_STRING([--enable-sndio], [support the sndio audio API [[default=yes]]]),
+                  , enable_sndioaudio=yes)
+    if test x$enable_audio = xyes -a x$enable_sndioaudio = xyes; then
+        AC_CHECK_HEADER(sndio.h, have_sndio_hdr=yes)
+        AC_CHECK_LIB(sndio, sio_open, have_sndio_lib=yes)
+
+        AC_MSG_CHECKING(for sndio support)
+        have_sndio=no
+
+        if test x$have_sndio_hdr = xyes -a x$have_sndio_lib = xyes; then
+            have_sndio=yes
+            SNDIO_LIBS="-lsndio"
+        fi
+
+        AC_MSG_RESULT($have_sndio)
+
+        if test x$have_sndio = xyes; then
+            AC_DEFINE(SDL_AUDIO_DRIVER_SNDIO)
+            SOURCES="$SOURCES $srcdir/src/audio/sndio/*.c"
+            EXTRA_LDFLAGS="$EXTRA_LDFLAGS $SNDIO_LIBS"
+            have_audio=yes
+        fi
+    fi
+}
+
 dnl Find PulseAudio
 CheckPulseAudio()
 {
@@ -860,8 +889,8 @@ CheckVisibilityHidden()
     save_CFLAGS="$CFLAGS"
     CFLAGS="$save_CFLAGS $visibility_CFLAGS -Werror"
     AC_TRY_COMPILE([
-    #if !defined(__GNUC__) || __GNUC__ < 4
-    #error SDL only uses visibility attributes in GCC 4 or newer
+    #if !defined(__GNUC__) || __GNUC__ < 3
+    #error SDL only uses visibility attributes in GCC 3 or newer
     #endif
     ],[
     ],[
@@ -1005,6 +1034,12 @@ AC_HELP_STRING([--enable-x11-shared], [dynamically loa
                     x11_lib='libX11.so'
                     x11ext_lib='libXext.so'
                     ;;
+                *-*-openbsd*)
+                    x11_lib='libX11.so'
+                    x11ext_lib='libXext.so'
+                    xrender_lib='libXrender.so'
+                    xrandr_lib='libXrandr.so'
+                    ;;
                 *)
                     x11_lib=[`find_lib "libX11.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
                     x11ext_lib=[`find_lib "libXext.so.*" "$X_LIBS -L/usr/X11/$base_libdir -L/usr/X11R6/$base_libdir" | sed 's/.*\/\(.*\)/\1/; q'`]
@@ -1034,7 +1069,7 @@ AC_HELP_STRING([--enable-x11-shared], [dynamically loa
             fi
             if test x$x11_symbols_private != xyes && \
                test x$enable_x11_shared = xyes; then
-                AC_MSG_WARN([You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading])
+                AC_MSG_WARN([You must have gcc3 (-fvisibility=hidden) for dynamic X11 loading])
                 enable_x11_shared=no
             fi
 
@@ -2358,6 +2393,7 @@ case "$host" in
         CheckALSA
         CheckARTSC
         CheckESD
+        CheckSndio
         CheckPulseAudio
         CheckNAS
         CheckX11
@@ -2390,7 +2426,7 @@ case "$host" in
                 SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
                 have_audio=yes
             ;;
-            netbsd|openbsd)
+            netbsd)
                 AC_DEFINE(SDL_AUDIO_DRIVER_BSD)
                 SOURCES="$SOURCES $srcdir/src/audio/bsd/*.c"
                 have_audio=yes
